#pragma once


#include <vector>

using namespace std;

class term;

/*
 * The abstract of the polynomial
 * @author hujingfei914@msn.com
 */
class polynomial
{
public:
	polynomial(void);	
	~polynomial(void);
	friend polynomial& operator % (polynomial &p1, polynomial &p2);
	friend bool operator == (polynomial &p1, polynomial &p2);
	friend polynomial& operator *(polynomial &p1, polynomial &p2);
	polynomial& operator =(polynomial &p1);
	polynomial& modulo(unsigned int n, unsigned int r);
	polynomial& multiModulo(polynomial &p1, unsigned int n, unsigned int r);
	void Add(term*);	
	void Add(term*, int n);	
	void toString(void);
	void clear(void);
	int length(void);
	
private:
	vector<term*> poly;	
};
